var WB =(function(){
	var obj={width:800,height:600,url:'',title:''}
	var i=0;
	return {
		op:function(conf){
		  extend(obj,conf)
		  window.parent.HOME.parent_open(obj);
		},
		wopen:function(conf){
			if(conf&&conf.full){//全屏打开
				conf.height= screen.height-70;
				conf.width= screen.width-10;
			}
			extend(obj,conf)
			var na = obj.wn||'';
			//window.open (obj.url,'newwindow','height='+obj.height+',width='+obj.width+',top=0,left=0,location=no,toolbar=yes,menubar=no,scrollbars=no, resizable=yes,status=no');
			window.open (obj.url,'newwindow'+na,'height='+obj.height+',width='+obj.width+',top=0,left=0,location=no,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,status=no');
		}
	}
})();

function WBFS(o){
	var T=this;
	T.o =o;
	T.button = util.$(o.btn);
	T.input = !!o.input?util.$(o.input):util.$(o.btn+'_input');
	T.input.readonly=true;//'readonly';
	T.input.style.width="320px";
	T.callback=o.callback;
	T.button.onclick=function(){
	   o.w=window,o.wbfs=T;
	   o.width=810,o.height=500;
	   WB.op(o);	
	};
	T.cb = function(v){
		if(T.callback){
			T.callback(T,v);
		}else{
			T.input.value=v||'';
		    T.input.focus();
		}
	}
}

function extend(f,s){
   if((!f)||!(s))return;
   for(var p in s){
     if(s[p]){f[p] = s[p];}
   }
}

function winOpen(flash,title){
    var wininfo = "width=520,height=580,resizable=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,left=20";
    var pop_win = window.open("","nw",wininfo);
    pop_win.resizeTo(520,580);
    pop_win.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
    pop_win.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml">');
    pop_win.document.writeln('<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>视频播放--'+(title||'')+'</title><style type="text/css">');
    pop_win.document.writeln('* { margin:0px; padding:0px} </style></head>');
    pop_win.document.writeln('<body>'+flash+'</body>');
    pop_win.document.close();
 }